Disallow absolute deadlines for relative cancel scopes#3403
Disallow absolute deadlines for relative cancel scopes#3403A5rocks wants to merge 4 commits intopython-trio:mainfrom
Conversation
b97ab8b to
ef54ef3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3403 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 128 128
Lines 19424 19417 -7
Branches 1318 1316 -2
===============================================
- Hits 19424 19417 -7
🚀 New features to boost your workflow:
|
|
I've added a change that allows |
I think this is slightly footgunny: with trio.CancelScope(relative_deadline=7) as cs:
...
# nvm we want delay it 10 seconds
cs.deadline = 10
# oops now we instantly cancelthe properties are so similarly named, that I think it could be easy to mistakenly type one instead of the other, or overlook/get confused when reading the code. And I don't think it's a necessary API since if you really want to "switch type" you can do so explicitly by doing simple math with |
This just converts our deprecations into
RuntimeErrors. It's been long enough!